package com.ddlaw.serviceImpl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ddlaw.entity.TLawQuestionCustom;
import com.ddlaw.entity.TLawQuestions;
import com.ddlaw.entity.TLawReply;
import com.ddlaw.entity.TLawReplyCustom;
import com.ddlaw.mapper.TLawQuestionsMapper;
import com.ddlaw.service.LawQuestionService;

@Service
@Transactional
public class LawQuestionServiceImpl implements LawQuestionService{

	@Resource
	TLawQuestionsMapper questionsMapper;
	
	
	@Override
	public void addQuestion(TLawQuestions questions) {
				questionsMapper.addQuestion(questions);
	}
	
	@Override
	public List<TLawReplyCustom> getQuesById(int lawyerId) {
				return questionsMapper.getQuesById(lawyerId);
	}

	@Override
	public List<TLawQuestionCustom> getUserQues(Map<String,Object> params) {
		// TODO Auto-generated method stub
		return questionsMapper.getUserQues(params);
	}
	
	@Override
	public List<TLawReplyCustom> getLawyerAns(Map<String, Object> params) {
		// TODO Auto-generated method stub
		return questionsMapper.getLawyerAns(params);
	}
	
	@Override
	public List<TLawQuestionCustom> getNoAnsQues(int lawyerId, int state) {
		// TODO Auto-generated method stub
		return questionsMapper.getNoAnsQues(lawyerId, state);
	}
	
	@Override
	public void addAnsToUser(TLawReply reply) {
		// TODO Auto-generated method stub
		questionsMapper.addAnsToUser(reply);
	}
	
	@Override
	public void updateQuesState(int state,int quesId) {
		// TODO Auto-generated method stub
		questionsMapper.updateQuesState(state,quesId);
	}
}
